<?php

/**
 * Recruitment form base class.
 *
 * @method Recruitment getObject() Returns the current form's model object
 *
 * @package    raidpoints
 * @subpackage form
 * @author     David Driscoll
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseRecruitmentForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'classid'  => new sfWidgetFormInputHidden(),
      'statusid' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Recruitmentstatu'), 'add_empty' => false)),
      'color'    => new sfWidgetFormInputText(),
      'notes'    => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'classid'  => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'classid', 'required' => false)),
      'statusid' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Recruitmentstatu'))),
      'color'    => new sfValidatorString(array('max_length' => 7)),
      'notes'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('recruitment[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Recruitment';
  }

}
